Skip to content

ci: rearchitect and streamline CI - #143

Merged
indradhanush merged 3 commits into
mainfrom
dg/ci-rearchitect-no-workflow-run
Aug 11, 2026
Merged

ci: rearchitect and streamline CI#143
indradhanush merged 3 commits into
mainfrom
dg/ci-rearchitect-no-workflow-run

Conversation

@indradhanush

@indradhanush indradhanush commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

With this PR, the GitHub CI will take ownership of building and pushing the agent bundle and controller-manager image directly to quay.io/platform9/cluster-api-provider-bringyourownhost. Additionally, we'll tag each artifact with its own unique tag derived from its git commit.

We also enable all the E2E suites to run in parallel, so some e2e specific changes were required here.

Note that: Now we run all E2E suites which was not the case previously. So E2E will now fail again from this PR onwards. To be fixed in follow ups.

Architecture

PR event / push to main / push tag with pattern `ci-*` (to explicitly trigger all CI runs)
  |
  |-- (unchanged, same as current behaviour) Security scan, golangci-lint,
  |    "Merge on lgtm label", Pull Request Labeler, markdown-links checks
  |
  |-- .github/workflows/build-agent-bundle.yml
  |     +-- build-host-agent-binary   (upload as artifact to reuse later in GitHub actions)
  |     |   
  |     +-- build-agent-bundle        (packages the .deb, upload as artifact to reuse later in GitHub actions; only push to quay for main)
  |
  |-- .github/workflows/unit-test.yml (standalalone, runs unit tests)
  |
  |-- .github/workflows/build-controller-manager.yml
  |     |
  |     +-- build-controller-manager   (upload as artifact to reuse later in GitHub actions; only push to quay for main)
  |
  \-- .github/workflows/e2e.yml
        |
        +-- e2e
             +-- poll for
             |   build-controller-manager and build-controller-manager jobs.
             |
             +-- download that job's image artifact
             |
             +-- run e2e tests concurrently with GINKGO_NODES=7

Stack created with GitHub Stacks CLIGive Feedback 💬

Comment thread .github/workflows/build-agent-bundle.yml Fixed
Comment thread .github/workflows/build-agent-bundle.yml Fixed
Comment thread .github/workflows/build-controller-manager.yml Fixed
Comment thread .github/workflows/e2e.yml Fixed
@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from e92c0e5 to e5324bc Compare July 20, 2026 12:45
@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch 6 times, most recently from deb13f1 to f2974bf Compare July 20, 2026 13:55
@indradhanush indradhanush changed the title dg/ci rearchitect no workflow run cI: rearchitect and streamline CI Jul 20, 2026
@indradhanush indradhanush changed the title cI: rearchitect and streamline CI ci: rearchitect and streamline CI Jul 20, 2026
@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from 509c444 to ffb44b9 Compare July 20, 2026 14:18
@indradhanush
indradhanush marked this pull request as ready for review July 20, 2026 15:42
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from ffb44b9 to 61db7a3 Compare July 20, 2026 17:38
@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from 61db7a3 to 61dd43e Compare July 31, 2026 16:01
@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from 61dd43e to 8c05983 Compare August 7, 2026 16:03
Comment thread .ci/build-agent-bundle.sh
Comment on lines +7 to +9
echo 'alias shasum="sha512sum"' >>~/.bashrc
# shellcheck disable=SC1090 # sourcing the user's own ~/.bashrc, not a repo file shellcheck can resolve
source ~/.bashrc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not super happy with this. this is pulling unknown stuff.

Comment thread .ci/build-agent-bundle.sh
Comment on lines +11 to +12
echo "removing build/ if already present"
rm -rf build/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make clean?

IMAGE_REGISTRY_NAME_TAG=${IMAGE_REGISTRY}/${IMAGE_NAME_TAG}

# make -C implicitly enables --print-directory on some GNU Make versions
# (confirmed: not on this repo's dev-Mac Make 3.81, but yes on the Ubuntu

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cut the noise

Comment thread .ci/build-controller-manager.sh

info "Verifying prerequisites"
#which aws > /dev/null || (echo "error: missing required command 'aws'" && exit 1)
which docker >/dev/null || (echo "error: missing required command 'docker'" && exit 1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why bother? this will fail anyway later

Comment thread test/e2e/docker_helper.go
bootstrapKubeconfigPath, err := uniqueTempFilePath("bootstrap-kubeconfig-*")
Expect(err).NotTo(HaveOccurred())
defer func() {
if removeErr := os.Remove(bootstrapKubeconfigPath); removeErr != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bootstrap kubeconfig is broken iirc?

Comment on lines +40 to +41
byoHostName1 = fmt.Sprintf("byohost1-%s", util.RandomString(6))
byoHostName2 = fmt.Sprintf("byohost2-%s", util.RandomString(6))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can we verify we can re-use existing hostnames?

Comment on lines +40 to +41
byoHostName1 = fmt.Sprintf("byohost1-%s", util.RandomString(6))
byoHostName2 = fmt.Sprintf("byohost2-%s", util.RandomString(6))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can we verify we can re-use existing hostnames?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a separate test where we test an explicit reuse.

Comment thread test/e2e/md_scale_test.go
)

var _ = Describe("When testing MachineDeployment scale out/in", func() {
var _ = Describe("When testing MachineDeployment scale out/in [MD-Scale]", func() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid running scale tests in the github action?

Comment thread Makefile
go run ./main.go

docker-build: ## Build docker image with the manager.
ifdef SKIP_BUILD

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make was orignally built to handle build dependencies to avoid compiline and building files twice. This feels wrong

@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from 8c05983 to 84b0172 Compare August 11, 2026 13:31
Base automatically changed from dg/migrate-quay-registry to main August 11, 2026 13:58
GINKGO_NODES runs multiple Ginkgo worker processes concurrently on the
same runner, sharing one Docker daemon and filesystem (unlike a
matrix-of-jobs design where each spec gets its own isolated VM). With
hardcoded names like "byohost1" or "/tmp/host-agent1.log" shared across
every spec file, two specs racing on the same runner would collide
trying to create the same container or write the same log/kubeconfig
path.

Suffix host/container names and log file paths with a random string per
spec, and generate the bootstrap kubeconfig's temp path via os.CreateTemp
instead of a single hardcoded path, so concurrent nodes never step on
each other's resources.
Split CI into 4 directly-triggered, standalone workflow files:
- build-agent-bundle
- build-controller-manager
- unit-test
- e2e

The build workflows will only push from main. But otherwise, are
pre-requisites for the E2E test, so that we do not rebuild the same
artifact in E2E again, and instead can reuse it from the build's
artifacts cache.

We dont want to use GitHub's workflow_run, because it's not possible to
show the status of the run on the PR / commit. As a result, use a
standalone script to wait for the build workflows to complete.
@indradhanush
indradhanush force-pushed the dg/ci-rearchitect-no-workflow-run branch from 84b0172 to 24806b9 Compare August 11, 2026 13:58
@indradhanush
indradhanush merged commit 0809a31 into main Aug 11, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants